#pragma once
#ifndef _RAYTRACER_TIMER_H_
#define _RAYTRACER_TIMER_H

#include <winnt.h>
#include <profileapi.h>

class Timer
{

public:
  Timer(){}
  Timer( const Timer & ){}
  ~Timer(){}

	void beginTimer(){
    ::QueryPerformanceCounter(&m_startTime);
  }
	void endTimer(){
    ::QueryPerformanceCounter(&m_endTime);
  }
	double elapsedTime(){
    return double(m_endTime.QuadPart-m_startTime.QuadPart)/double(m_freq.QuadPart);
  }
	//Timer&			operator =  ( const Timer& rhs );
	//bool			operator == ( const Timer& rhs ) const;
	//bool			operator != ( const Timer& rhs ) const;
	void			clear(){
    m_startTime.QuadPart = 0;
    m_endTime.QuadPart = 0;
    ::QueryPerformanceFrequency(&m_freq);
  }

private:

	LARGE_INTEGER				m_startTime;
	LARGE_INTEGER				m_endTime;
  LARGE_INTEGER       m_freq;
};


#endif